Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PICKME Refactor Email system to builder pattern #426

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

hakito
Copy link
Contributor

@hakito hakito commented Sep 29, 2024

When I was working on a feature it was quite difficult to implement it because of the current architecture of the email system. This PR holds the current state of my approach, but as it was too risky to break something else I stopped working on it. Maybe it's something for Version 3.0?

The EmailMessage is the base class for all message types and implements an interface. Some of the derived classes have a GetTemplateName method, some don't.

I thought the reason for the architecture is because of a manipulation of the EmailMessage object after it's creation. But it seems that is not the case. All code paths I found create the message and send it to phpmailer without additional modification.

I tried to replace it with a more straighforward builder pattern.

So far I replaced the first view classes with the builder pattern approach. When I came accross GuestAddedEmail wich derives from ReservationEmailMessage things got more complicated. I think this could still be resolved when using a mixture of the builder pattern and the derived class pattern here.

Todos:

Gerd Katzenbeisser added 12 commits September 25, 2024 11:29
Those should only be provided by the user.
The name is misleading, as it's not the default.language setting
DisplayLocalized in SmartyPage was never called
DisplayLocalized in Page was only a copy, which is still called, but the languageCode parameter is not used.
..but only when custom template is available for default lang.

refs LibreBooking#416
It conflicts with the now protected email property
@hakito hakito mentioned this pull request Sep 29, 2024
@hakito hakito changed the title Refactor Email system to builder pattern PICKME Refactor Email system to builder pattern Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Forgot Password changes the language
1 participant